<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="合同流水号" prop="sequenceNumber">
        <el-input
          v-model="queryParams.sequenceNumber"
          placeholder="请输入合同流水号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="合同关联号" prop="contractAssociationNo">
        <el-input
          v-model="queryParams.contractAssociationNo"
          placeholder="请输入合同关联号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="采购卡片/合同/协议" prop="purchaseCard">
        <el-input
          v-model="queryParams.purchaseCard"
          placeholder="请输入采购卡片/合同/协议"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目名称" prop="projectName">
        <el-input
          v-model="queryParams.projectName"
          placeholder="请输入项目名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装备名称" prop="equipName">
        <el-input
          v-model="queryParams.equipName"
          placeholder="请输入装备名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装备型号" prop="equipVersion">
        <el-input
          v-model="queryParams.equipVersion"
          placeholder="请输入装备型号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="数量" prop="quantity">
        <el-input
          v-model="queryParams.quantity"
          placeholder="请输入数量"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="技术状态" prop="technicalConditions">
        <el-input
          v-model="queryParams.technicalConditions"
          placeholder="请输入技术状态"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="合同编号" prop="contractNo">
        <el-input
          v-model="queryParams.contractNo"
          placeholder="请输入合同编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="合同类型" prop="contractDeclare">
        <el-input
          v-model="queryParams.contractDeclare"
          placeholder="请输入合同类型"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="监管JS代表室" prop="representativeOffice">
        <el-input
          v-model="queryParams.representativeOffice"
          placeholder="请输入监管JS代表室"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="监管事项" prop="regulation">
        <el-input
          v-model="queryParams.regulation"
          placeholder="请输入监管事项"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="采购部门" prop="purchasingDepartment">
        <el-input
          v-model="queryParams.purchasingDepartment"
          placeholder="请输入采购部门"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目管理机构" prop="managementAgency">
        <el-input
          v-model="queryParams.managementAgency"
          placeholder="请输入项目管理机构"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="任务确认时间" prop="taskConfirmationTime">
        <el-date-picker clearable
          v-model="queryParams.taskConfirmationTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择任务确认时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="主管人员" prop="executiveStaff">
        <el-input
          v-model="queryParams.executiveStaff"
          placeholder="请输入主管人员"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="完成时间" prop="completionTime">
        <el-date-picker clearable
          v-model="queryParams.completionTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择完成时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="交付时间" prop="deliveryTime">
        <el-date-picker clearable
          v-model="queryParams.deliveryTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择交付时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="发文字号" prop="messageNumber">
        <el-input
          v-model="queryParams.messageNumber"
          placeholder="请输入发文字号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="计划名称" prop="planName">
        <el-input
          v-model="queryParams.planName"
          placeholder="请输入计划名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="M级" prop="security">
        <el-input
          v-model="queryParams.security"
          placeholder="请输入M级"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="发文日期" prop="messageDate">
        <el-date-picker clearable
          v-model="queryParams.messageDate"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择发文日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="正式任务/任务预告" prop="formalTask">
        <el-input
          v-model="queryParams.formalTask"
          placeholder="请输入正式任务/任务预告"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装备采购部门" prop="procurementDepartment">
        <el-input
          v-model="queryParams.procurementDepartment"
          placeholder="请输入装备采购部门"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目编号" prop="projectNo">
        <el-input
          v-model="queryParams.projectNo"
          placeholder="请输入项目编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="采购类别" prop="purchaseCategory">
        <el-input
          v-model="queryParams.purchaseCategory"
          placeholder="请输入采购类别"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目预估经费" prop="projectFunds">
        <el-input
          v-model="queryParams.projectFunds"
          placeholder="请输入项目预估经费"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="承制单位" prop="manufacturer">
        <el-input
          v-model="queryParams.manufacturer"
          placeholder="请输入承制单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否异地监管" prop="remoteSupervision">
        <el-input
          v-model="queryParams.remoteSupervision"
          placeholder="请输入是否异地监管"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="所属军代局" prop="representativeOfficeBelongs">
        <el-input
          v-model="queryParams.representativeOfficeBelongs"
          placeholder="请输入所属军代局"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="所属军代局主管机关" prop="competentAuthorityAgency">
        <el-input
          v-model="queryParams.competentAuthorityAgency"
          placeholder="请输入所属军代局主管机关"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="时间要求" prop="timeRequirements">
        <el-input
          v-model="queryParams.timeRequirements"
          placeholder="请输入时间要求"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="项目实际总金额" prop="actualTotalAmount">
        <el-input
          v-model="queryParams.actualTotalAmount"
          placeholder="请输入项目实际总金额"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="备注" prop="note">
        <el-input
          v-model="queryParams.note"
          placeholder="请输入备注"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="用户ID" prop="userId">
        <el-input
          v-model="queryParams.userId"
          placeholder="请输入用户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="部门ID" prop="deptId">
        <el-input
          v-model="queryParams.deptId"
          placeholder="请输入部门ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="装备承制单位" prop="equipmentContractor">
        <el-input
          v-model="queryParams.equipmentContractor"
          placeholder="请输入装备承制单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="支付时间" prop="paymentTime">
        <el-input
          v-model="queryParams.paymentTime"
          placeholder="请输入支付时间"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="进度要求" prop="scheduleTarget">
        <el-input
          v-model="queryParams.scheduleTarget"
          placeholder="请输入进度要求"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="承制单位" prop="contractorUnit">
        <el-input
          v-model="queryParams.contractorUnit"
          placeholder="请输入承制单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="配套设备名称" prop="supportingEquipment">
        <el-input
          v-model="queryParams.supportingEquipment"
          placeholder="请输入配套设备名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="配套合同/协议号" prop="matchingContractNo">
        <el-input
          v-model="queryParams.matchingContractNo"
          placeholder="请输入配套合同/协议号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="总体JS代表室" prop="generalRepresentativeOffice">
        <el-input
          v-model="queryParams.generalRepresentativeOffice"
          placeholder="请输入总体JS代表室"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="总体装备承制单位" prop="generalContractorUnit">
        <el-input
          v-model="queryParams.generalContractorUnit"
          placeholder="请输入总体装备承制单位"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建者" prop="createBy">
        <el-input
          v-model="queryParams.createBy"
          placeholder="请输入创建者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="创建时间" prop="createTime">
        <el-date-picker clearable
          v-model="queryParams.createTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择创建时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item label="更新者" prop="updateBy">
        <el-input
          v-model="queryParams.updateBy"
          placeholder="请输入更新者"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="更新时间" prop="updateTime">
        <el-date-picker clearable
          v-model="queryParams.updateTime"
          type="date"
          value-format="yyyy-MM-dd"
          placeholder="请选择更新时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:contract:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:contract:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:contract:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:contract:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="contractList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="合同流水号" align="center" prop="sequenceNumber" />
      <el-table-column label="合同关联号" align="center" prop="contractAssociationNo" />
      <el-table-column label="采购卡片/合同/协议" align="center" prop="purchaseCard" />
      <el-table-column label="项目名称" align="center" prop="projectName" />
      <el-table-column label="合同类别" align="center" prop="contractType" />
      <el-table-column label="装备名称" align="center" prop="equipName" />
      <el-table-column label="装备型号" align="center" prop="equipVersion" />
      <el-table-column label="数量" align="center" prop="quantity" />
      <el-table-column label="技术状态" align="center" prop="technicalConditions" />
      <el-table-column label="合同编号" align="center" prop="contractNo" />
      <el-table-column label="合同类型" align="center" prop="contractDeclare" />
      <el-table-column label="监管JS代表室" align="center" prop="representativeOffice" />
      <el-table-column label="监管事项" align="center" prop="regulation" />
      <el-table-column label="项目类别" align="center" prop="projectType" />
      <el-table-column label="采购部门" align="center" prop="purchasingDepartment" />
      <el-table-column label="项目管理机构" align="center" prop="managementAgency" />
      <el-table-column label="任务确认时间" align="center" prop="taskConfirmationTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.taskConfirmationTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="主管人员" align="center" prop="executiveStaff" />
      <el-table-column label="任务状态" align="center" prop="taskStatus" />
      <el-table-column label="完成时间" align="center" prop="completionTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.completionTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="交付时间" align="center" prop="deliveryTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.deliveryTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="发文字号" align="center" prop="messageNumber" />
      <el-table-column label="计划名称" align="center" prop="planName" />
      <el-table-column label="M级" align="center" prop="security" />
      <el-table-column label="发文日期" align="center" prop="messageDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.messageDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="正式任务/任务预告" align="center" prop="formalTask" />
      <el-table-column label="装备采购部门" align="center" prop="procurementDepartment" />
      <el-table-column label="项目编号" align="center" prop="projectNo" />
      <el-table-column label="采购类别" align="center" prop="purchaseCategory" />
      <el-table-column label="项目预估经费" align="center" prop="projectFunds" />
      <el-table-column label="承制单位" align="center" prop="manufacturer" />
      <el-table-column label="是否异地监管" align="center" prop="remoteSupervision" />
      <el-table-column label="所属军代局" align="center" prop="representativeOfficeBelongs" />
      <el-table-column label="所属军代局主管机关" align="center" prop="competentAuthorityAgency" />
      <el-table-column label="时间要求" align="center" prop="timeRequirements" />
      <el-table-column label="项目实际总金额" align="center" prop="actualTotalAmount" />
      <el-table-column label="备注" align="center" prop="note" />
      <el-table-column label="用户ID" align="center" prop="userId" />
      <el-table-column label="部门ID" align="center" prop="deptId" />
      <el-table-column label="装备承制单位" align="center" prop="equipmentContractor" />
      <el-table-column label="支付时间" align="center" prop="paymentTime" />
      <el-table-column label="合同关联状态" align="center" prop="contractAssociationStatus" />
      <el-table-column label="进度要求" align="center" prop="scheduleTarget" />
      <el-table-column label="承制单位" align="center" prop="contractorUnit" />
      <el-table-column label="配套设备名称" align="center" prop="supportingEquipment" />
      <el-table-column label="配套合同/协议号" align="center" prop="matchingContractNo" />
      <el-table-column label="总体JS代表室" align="center" prop="generalRepresentativeOffice" />
      <el-table-column label="总体装备承制单位" align="center" prop="generalContractorUnit" />
      <el-table-column label="创建者" align="center" prop="createBy" />
      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="更新者" align="center" prop="updateBy" />
      <el-table-column label="更新时间" align="center" prop="updateTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark" />
      <el-table-column label="备注1" align="center" prop="note1" />
      <el-table-column label="备注2" align="center" prop="note2" />
      <el-table-column label="备注3" align="center" prop="note3" />
      <el-table-column label="备注4" align="center" prop="note4" />
      <el-table-column label="备注5" align="center" prop="note5" />
      <el-table-column label="备注6" align="center" prop="note6" />
      <el-table-column label="备注6" align="center" prop="note7" />
      <el-table-column label="备注8" align="center" prop="note8" />
      <el-table-column label="备注9" align="center" prop="note9" />
      <el-table-column label="备注10" align="center" prop="note10" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['system:contract:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['system:contract:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改任务对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="合同流水号" prop="sequenceNumber">
          <el-input v-model="form.sequenceNumber" placeholder="请输入合同流水号" />
        </el-form-item>
        <el-form-item label="合同关联号" prop="contractAssociationNo">
          <el-input v-model="form.contractAssociationNo" placeholder="请输入合同关联号" />
        </el-form-item>
        <el-form-item label="采购卡片/合同/协议" prop="purchaseCard">
          <el-input v-model="form.purchaseCard" placeholder="请输入采购卡片/合同/协议" />
        </el-form-item>
        <el-form-item label="项目名称" prop="projectName">
          <el-input v-model="form.projectName" placeholder="请输入项目名称" />
        </el-form-item>
        <el-form-item label="装备名称" prop="equipName">
          <el-input v-model="form.equipName" placeholder="请输入装备名称" />
        </el-form-item>
        <el-form-item label="装备型号" prop="equipVersion">
          <el-input v-model="form.equipVersion" placeholder="请输入装备型号" />
        </el-form-item>
        <el-form-item label="数量" prop="quantity">
          <el-input v-model="form.quantity" placeholder="请输入数量" />
        </el-form-item>
        <el-form-item label="技术状态" prop="technicalConditions">
          <el-input v-model="form.technicalConditions" placeholder="请输入技术状态" />
        </el-form-item>
        <el-form-item label="合同编号" prop="contractNo">
          <el-input v-model="form.contractNo" placeholder="请输入合同编号" />
        </el-form-item>
        <el-form-item label="合同类型" prop="contractDeclare">
          <el-input v-model="form.contractDeclare" placeholder="请输入合同类型" />
        </el-form-item>
        <el-form-item label="监管JS代表室" prop="representativeOffice">
          <el-input v-model="form.representativeOffice" placeholder="请输入监管JS代表室" />
        </el-form-item>
        <el-form-item label="监管事项" prop="regulation">
          <el-input v-model="form.regulation" placeholder="请输入监管事项" />
        </el-form-item>
        <el-form-item label="采购部门" prop="purchasingDepartment">
          <el-input v-model="form.purchasingDepartment" placeholder="请输入采购部门" />
        </el-form-item>
        <el-form-item label="项目管理机构" prop="managementAgency">
          <el-input v-model="form.managementAgency" placeholder="请输入项目管理机构" />
        </el-form-item>
        <el-form-item label="任务确认时间" prop="taskConfirmationTime">
          <el-date-picker clearable
            v-model="form.taskConfirmationTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择任务确认时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="主管人员" prop="executiveStaff">
          <el-input v-model="form.executiveStaff" placeholder="请输入主管人员" />
        </el-form-item>
        <el-form-item label="完成时间" prop="completionTime">
          <el-date-picker clearable
            v-model="form.completionTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择完成时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="交付时间" prop="deliveryTime">
          <el-date-picker clearable
            v-model="form.deliveryTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择交付时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="发文字号" prop="messageNumber">
          <el-input v-model="form.messageNumber" placeholder="请输入发文字号" />
        </el-form-item>
        <el-form-item label="计划名称" prop="planName">
          <el-input v-model="form.planName" placeholder="请输入计划名称" />
        </el-form-item>
        <el-form-item label="M级" prop="security">
          <el-input v-model="form.security" placeholder="请输入M级" />
        </el-form-item>
        <el-form-item label="发文日期" prop="messageDate">
          <el-date-picker clearable
            v-model="form.messageDate"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="请选择发文日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="正式任务/任务预告" prop="formalTask">
          <el-input v-model="form.formalTask" placeholder="请输入正式任务/任务预告" />
        </el-form-item>
        <el-form-item label="装备采购部门" prop="procurementDepartment">
          <el-input v-model="form.procurementDepartment" placeholder="请输入装备采购部门" />
        </el-form-item>
        <el-form-item label="项目编号" prop="projectNo">
          <el-input v-model="form.projectNo" placeholder="请输入项目编号" />
        </el-form-item>
        <el-form-item label="采购类别" prop="purchaseCategory">
          <el-input v-model="form.purchaseCategory" placeholder="请输入采购类别" />
        </el-form-item>
        <el-form-item label="项目预估经费" prop="projectFunds">
          <el-input v-model="form.projectFunds" placeholder="请输入项目预估经费" />
        </el-form-item>
        <el-form-item label="承制单位" prop="manufacturer">
          <el-input v-model="form.manufacturer" placeholder="请输入承制单位" />
        </el-form-item>
        <el-form-item label="是否异地监管" prop="remoteSupervision">
          <el-input v-model="form.remoteSupervision" placeholder="请输入是否异地监管" />
        </el-form-item>
        <el-form-item label="所属军代局" prop="representativeOfficeBelongs">
          <el-input v-model="form.representativeOfficeBelongs" placeholder="请输入所属军代局" />
        </el-form-item>
        <el-form-item label="所属军代局主管机关" prop="competentAuthorityAgency">
          <el-input v-model="form.competentAuthorityAgency" placeholder="请输入所属军代局主管机关" />
        </el-form-item>
        <el-form-item label="时间要求" prop="timeRequirements">
          <el-input v-model="form.timeRequirements" placeholder="请输入时间要求" />
        </el-form-item>
        <el-form-item label="项目实际总金额" prop="actualTotalAmount">
          <el-input v-model="form.actualTotalAmount" placeholder="请输入项目实际总金额" />
        </el-form-item>
        <el-form-item label="备注" prop="note">
          <el-input v-model="form.note" placeholder="请输入备注" />
        </el-form-item>
        <el-form-item label="用户ID" prop="userId">
          <el-input v-model="form.userId" placeholder="请输入用户ID" />
        </el-form-item>
        <el-form-item label="部门ID" prop="deptId">
          <el-input v-model="form.deptId" placeholder="请输入部门ID" />
        </el-form-item>
        <el-form-item label="装备承制单位" prop="equipmentContractor">
          <el-input v-model="form.equipmentContractor" placeholder="请输入装备承制单位" />
        </el-form-item>
        <el-form-item label="支付时间" prop="paymentTime">
          <el-input v-model="form.paymentTime" placeholder="请输入支付时间" />
        </el-form-item>
        <el-form-item label="进度要求" prop="scheduleTarget">
          <el-input v-model="form.scheduleTarget" placeholder="请输入进度要求" />
        </el-form-item>
        <el-form-item label="承制单位" prop="contractorUnit">
          <el-input v-model="form.contractorUnit" placeholder="请输入承制单位" />
        </el-form-item>
        <el-form-item label="配套设备名称" prop="supportingEquipment">
          <el-input v-model="form.supportingEquipment" placeholder="请输入配套设备名称" />
        </el-form-item>
        <el-form-item label="配套合同/协议号" prop="matchingContractNo">
          <el-input v-model="form.matchingContractNo" placeholder="请输入配套合同/协议号" />
        </el-form-item>
        <el-form-item label="总体JS代表室" prop="generalRepresentativeOffice">
          <el-input v-model="form.generalRepresentativeOffice" placeholder="请输入总体JS代表室" />
        </el-form-item>
        <el-form-item label="总体装备承制单位" prop="generalContractorUnit">
          <el-input v-model="form.generalContractorUnit" placeholder="请输入总体装备承制单位" />
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注1" prop="note1">
          <el-input v-model="form.note1" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注2" prop="note2">
          <el-input v-model="form.note2" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注3" prop="note3">
          <el-input v-model="form.note3" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注4" prop="note4">
          <el-input v-model="form.note4" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注5" prop="note5">
          <el-input v-model="form.note5" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注6" prop="note6">
          <el-input v-model="form.note6" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注6" prop="note7">
          <el-input v-model="form.note7" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注8" prop="note8">
          <el-input v-model="form.note8" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注9" prop="note9">
          <el-input v-model="form.note9" type="textarea" placeholder="请输入内容" />
        </el-form-item>
        <el-form-item label="备注10" prop="note10">
          <el-input v-model="form.note10" type="textarea" placeholder="请输入内容" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listContract, getContract, delContract, addContract, updateContract } from "@/api/system/contract";

export default {
  name: "Contract",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 任务表格数据
      contractList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        sequenceNumber: null,
        contractAssociationNo: null,
        purchaseCard: null,
        projectName: null,
        contractType: null,
        equipName: null,
        equipVersion: null,
        quantity: null,
        technicalConditions: null,
        contractNo: null,
        contractDeclare: null,
        representativeOffice: null,
        regulation: null,
        projectType: null,
        purchasingDepartment: null,
        managementAgency: null,
        taskConfirmationTime: null,
        executiveStaff: null,
        taskStatus: null,
        completionTime: null,
        deliveryTime: null,
        messageNumber: null,
        planName: null,
        security: null,
        messageDate: null,
        formalTask: null,
        procurementDepartment: null,
        projectNo: null,
        purchaseCategory: null,
        projectFunds: null,
        manufacturer: null,
        remoteSupervision: null,
        representativeOfficeBelongs: null,
        competentAuthorityAgency: null,
        timeRequirements: null,
        actualTotalAmount: null,
        note: null,
        userId: null,
        deptId: null,
        equipmentContractor: null,
        paymentTime: null,
        contractAssociationStatus: null,
        scheduleTarget: null,
        contractorUnit: null,
        supportingEquipment: null,
        matchingContractNo: null,
        generalRepresentativeOffice: null,
        generalContractorUnit: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询任务列表 */
    getList() {
      this.loading = true;
      listContract(this.queryParams).then(response => {
        this.contractList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        sequenceNumber: null,
        contractAssociationNo: null,
        purchaseCard: null,
        projectName: null,
        contractType: null,
        equipName: null,
        equipVersion: null,
        quantity: null,
        technicalConditions: null,
        contractNo: null,
        contractDeclare: null,
        representativeOffice: null,
        regulation: null,
        projectType: null,
        purchasingDepartment: null,
        managementAgency: null,
        taskConfirmationTime: null,
        executiveStaff: null,
        taskStatus: "0",
        completionTime: null,
        deliveryTime: null,
        messageNumber: null,
        planName: null,
        security: null,
        messageDate: null,
        formalTask: null,
        procurementDepartment: null,
        projectNo: null,
        purchaseCategory: null,
        projectFunds: null,
        manufacturer: null,
        remoteSupervision: null,
        representativeOfficeBelongs: null,
        competentAuthorityAgency: null,
        timeRequirements: null,
        actualTotalAmount: null,
        note: null,
        userId: null,
        deptId: null,
        equipmentContractor: null,
        paymentTime: null,
        contractAssociationStatus: "0",
        scheduleTarget: null,
        contractorUnit: null,
        supportingEquipment: null,
        matchingContractNo: null,
        generalRepresentativeOffice: null,
        generalContractorUnit: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        note1: null,
        note2: null,
        note3: null,
        note4: null,
        note5: null,
        note6: null,
        note7: null,
        note8: null,
        note9: null,
        note10: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加任务";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getContract(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改任务";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateContract(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addContract(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除任务编号为"' + ids + '"的数据项？').then(function() {
        return delContract(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/contract/export', {
        ...this.queryParams
      }, `contract_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
